package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SmsIntegralRuleMapper;
import com.ruoyi.system.domain.SmsIntegralRule;
import com.ruoyi.system.service.ISmsIntegralRuleService;

/**
 * 奖励规则Service业务层处理
 *
 * @author DRIES
 * @date 2022-03-09
 */
@Service
public class SmsIntegralRuleServiceImpl implements ISmsIntegralRuleService
{
    @Autowired
    private SmsIntegralRuleMapper smsIntegralRuleMapper;

    /**
     * 查询奖励规则
     *
     * @param id 奖励规则主键
     * @return 奖励规则
     */
    @Override
    public SmsIntegralRule selectSmsIntegralRuleById(Long id)
    {
        return smsIntegralRuleMapper.selectSmsIntegralRuleById(id);
    }

    /**
     * 查询奖励规则列表
     *
     * @param smsIntegralRule 奖励规则
     * @return 奖励规则
     */
    @Override
    public List<SmsIntegralRule> selectSmsIntegralRuleList(SmsIntegralRule smsIntegralRule)
    {
        return smsIntegralRuleMapper.selectSmsIntegralRuleList(smsIntegralRule);
    }

    /**
     * 新增奖励规则
     *
     * @param smsIntegralRule 奖励规则
     * @return 结果
     */
    @Override
    public int insertSmsIntegralRule(SmsIntegralRule smsIntegralRule)
    {
        smsIntegralRule.setCreateTime(DateUtils.getNowDate());
        return smsIntegralRuleMapper.insertSmsIntegralRule(smsIntegralRule);
    }

    /**
     * 修改奖励规则
     *
     * @param smsIntegralRule 奖励规则
     * @return 结果
     */
    @Override
    public int updateSmsIntegralRule(SmsIntegralRule smsIntegralRule)
    {
        smsIntegralRule.setUpdateTime(DateUtils.getNowDate());
        return smsIntegralRuleMapper.updateSmsIntegralRule(smsIntegralRule);
    }

    /**
     * 批量删除奖励规则
     *
     * @param ids 需要删除的奖励规则主键
     * @return 结果
     */
    @Override
    public int deleteSmsIntegralRuleByIds(Long[] ids)
    {
        return smsIntegralRuleMapper.deleteSmsIntegralRuleByIds(ids);
    }

    /**
     * 删除奖励规则信息
     *
     * @param id 奖励规则主键
     * @return 结果
     */
    @Override
    public int deleteSmsIntegralRuleById(Long id)
    {
        return smsIntegralRuleMapper.deleteSmsIntegralRuleById(id);
    }
}
